var isSearch = false;
function search() {
    var father = document.getElementById('#cm_cr-review_list');
    var list = father.querySelectorAll('.review-title');
    console.log("list = " + list.length);
    if (list.length > 0) {
        for (var i = 0, len = list.length; i < len; i++) {
            var _self = list[i];
            if (_self.innerHTML.indexOf("Five Start") >= 0) {
                var parent = _self.parentNode;
                console.log("parent = " + parent);
                var helpful = parent.querySelectorAll('.a-button-input');
                console.log("按钮的个数：" + helpful.length);
                helpful[0].scrollIntoView(false);
                helpful[0].click();
                isSearch = true;
                return "ok";
            }
        }
        if (!isSearch) {
            var btn = document.querySelectorAll('a.a-button-text');
            console.log("更多评论按钮", btn);
            if (btn[0]) {
                btn[0].scrollIntoView(false);
                btn[0].click();
                setTimeout(function() {
                    search();
                }, 2000);
            } else {
                alert("没有匹配到");
                return "没有匹配到";
            }
        }
    } else {
        return "没有找到标题元素";
    }
}
search();